package com.dfbz.demo04_匿名内部类;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo02_匿名内部类的使用 {
    public static void main(String[] args) {

//        Person person=new Person();
//        person.chill();

        /*

        class Xxx implements Chill{

            @Override
            public void chill() {
                System.out.println("吃余干辣椒...");
            }
        }

        Chill c1 = new Xxx();
        c1.chill();


         */
        Chill c1 = new Chill() {
            @Override
            public void chill() {
                System.out.println("吃余干辣椒...");
            }
        };

        c1.chill();


        Chill c2 = new Chill() {
            @Override
            public void chill() {
                System.out.println("吃湖南线椒...");
            }
        };

        c2.chill();

    }
}
interface Chill{
    void chill();
}

class Person implements Chill{
    @Override
    public void chill() {
        System.out.println("吃朝天椒......");
    }
}